//统一管理咱们项目用户相关的接口
import request from '@/utils/request';
import type { loginFormData, commonResponseData } from './type';
//项目用户相关的请求地址
enum API {
  LOGIN_URL = '/auth/login',
  LOGOUT_URL = '/auth/logout',
  USER_INFO_URL = '/system/user/getInfo',
  VERIFY_CODE_URL = '/auth/code',
  PUBLICKEY_URL = '/getPublicKey',
}

//登录接口
export const reqLogin = (data: loginFormData) => request.post<loginFormData, commonResponseData>(API.LOGIN_URL, data);
//退出登录
export const reqLogout = () => request.post<any, any>(API.LOGOUT_URL);
// 获取用户信息
export const reqUserInfo = () => request.post<any, any>(API.USER_INFO_URL);
// 生成验证码
export const reqVerifyCode = () => request.post<any, commonResponseData>(API.VERIFY_CODE_URL);
// 获取加密公钥
export const reqPublicKey = () => request.get<any, any>(API.PUBLICKEY_URL);
